package com.wanxi.pack;

public class Student {
//    private String privateCard;
//    public String publicCard;
//    protected String protectedCard;
//    String card;

    int id;
    String name;
    private int age;
    String phone;
    String address;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if (age > 150) {
            System.out.println("你的年龄超过限制");
            this.age = 149;
            return;
        }
        if (age < 0) {
            System.out.println("你不是人");
            this.age = 0;
            return;
        }
        this.age = age;
    }

    public Student() {

    }

    public Student(int id, String name, int age, String phone, String address) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.phone = phone;
        this.address = address;

    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", phone='" + phone + '\'' +
                ", address='" + address + '\'' +
                '}';
    }

    public static void main(String[] args) {
        Student student = new Student();
    }
}
